import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class QueryWordPanel extends StatefulWidget {
  const QueryWordPanel({super.key});

  @override
  State<QueryWordPanel> createState() => _QueryWordPanelState();
}

class _QueryWordPanelState extends State<QueryWordPanel> {
  List<String> queryWordStack = [];

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        buildSearchBar(),
        queryWordStack.length > 0 ? buildQueryHistory() : buidlWordPanel()
      ],
    );
  }

  // 搜索栏
  buildSearchBar() {
    return Row(
      children: [
        Expanded(
          child: TextField(
              autofocus: true,
              decoration: InputDecoration(
                  labelText: "单词:",
                  hintText: "请输入单词",
                  prefixIcon: Icon(Icons.person))),
        ),
      ],
    );
  }

  // 查询历史
  buildQueryHistory() {
    return Container();
  }

  // 单词面板
  buidlWordPanel() {
    return Container();
  }
}
